Many updates, bringing in some changes from Ubuntu
authorXimin Luo <infinity0@debian.org>
Mon, 1 May 2017 14:54:17 +0000 (16:54 +0200)
committerXimin Luo <infinity0@debian.org>
Mon, 1 May 2017 14:54:17 +0000 (16:54 +0200)
13 files changed:
debian/README.source
debian/bootstrap.py
debian/cargo-vendor-unpack.py [deleted file]
debian/changelog
debian/control
debian/copyright
debian/deps-tarball-filter.txt [deleted file]
debian/deps-tarball-unsuspicious.txt [deleted file]
debian/gbp.conf
debian/make_orig_multi.sh
debian/rules
debian/vendor-tarball-filter.txt [new file with mode: 0644]
debian/vendor-tarball-unsuspicious.txt [new file with mode: 0644]

index 9cc1e9556389be8a9e4bc215315e358e9e54beb1..45757393d3c601fbfcdec8f8aa525392c581843e 100644 (file)
@@ -2,7 +2,7 @@ Updating the package
 ====================
 
 1. Run d/make_orig_multi.sh <version>.
-2. Verify the -deps component tarball to make sure it looks good.
+2. Verify the -vendor component tarball to make sure it looks good.
    If not, edit d/make_orig_multi.sh and the surrounding files (such as patches
    and exclude files) and repeat the above until it looks good.
 3. $ git fetch upstream
@@ -10,8 +10,8 @@ Updating the package
    $ git remote add upstream https://github.com/rust-lang/cargo
 4. $ gbp import-orig ../cargo_<version>.orig.tar.gz
    If you get errors, check the extra default flags in d/gbp.conf
-5. Check that no old versions remain in deps/. If there are, then your git repo
-   was messed up when you ran (4). Rewind the debian/sid, upstream, and
+5. Check that no old versions remain in vendor/. If there are, then your git
+   repo was messed up when you ran (4). Rewind the debian/sid, upstream, and
    pristine-tar branches, delete the upstream/<version> tag; this reverts step
    (4). Clean up your git repo, and then try (4) again.
 6. Update d/patches and the rest of the packaging, as normal.
@@ -38,7 +38,7 @@ This package currently resort to several workarounds to build cargo:
 
 As such, the original source is composed by two tarballs:
  * cargo source
- * dependencies crates (under deps/), stripped of unused embedded
+ * dependencies crates (under vendor/), stripped of unused embedded
    C libraries
 
  -- Luca Bruno <lucab@debian.org>  Sat, 13 Feb 2016 17:50:59 +0100
index e09ee2677ef5d13df03322b57b5caa3d5e2b1b68..fafd95876cf6d446de6284a32976b8f7dd42c931 100755 (executable)
@@ -1,5 +1,9 @@
 #!/usr/bin/env python
 """
+NOTE: This script has not been used for a very long time and very likely won't
+work. Please read the code before attempting to run it and hoping that "just
+fixing the errors" will work. -- infinity0
+
 About
 =====
 
diff --git a/debian/cargo-vendor-unpack.py b/debian/cargo-vendor-unpack.py
deleted file mode 100755 (executable)
index 1ab1406..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python3
-
-# Copyright: 2015 The Debian Project
-# License: MIT-License or Apache-2.0
-#
-# Helper to unpack a local crate registry to original sources
-# TODO: rewrite to perl and add to dh-cargo, maybe?
-
-import os
-import tarfile
-
-def main():
-  curdir = os.getcwd()
-  depsdir = os.path.join(curdir, "deps")
-  vendordir = os.path.join(curdir, "vendor")
-  cachedir = os.path.join(vendordir, "cache")
-  if not os.path.exists(depsdir):
-    os.makedirs(depsdir)
-
-  for _, names, _ in os.walk(top=cachedir):
-    for cratename in names:
-      for _, vers, _ in os.walk(top=os.path.join(cachedir, cratename)):
-        for cratever in vers:
-          crate = os.path.join(cachedir, cratename, cratever, "download")
-          tar = tarfile.open(crate)
-          tar.extractall(path=depsdir)
-          print("Unpacking crate deps %s" % crate)
-          tar.close()
-
-
-if __name__ == "__main__":
-  main()
index 69b2f807f079b9396973220a9cb185653049ddf5..c13ab63021a0308703f6b02d9f152d3df487cdd8 100644 (file)
@@ -1,3 +1,17 @@
+cargo (0.17.0-1~exp2) UNRELEASED; urgency=medium
+
+  * Bring in some changes from Ubuntu.
+    - Rename deps/ to vendor/ as that's what upstream uses, and update
+      other files with the new paths too.
+    - Remove cargo-vendor-unpack since we no longer need to postprocess
+      cargo-vendor output in that way.
+  * Document that bootstrap.py probably doesn't work now.
+  * Include /usr/share/rustc/architecture.mk in d/rules instead of duplicating
+    awkward arch-dependent Makefile snippets.
+  * Don't embed libgit2, add a versioned B-D to libgit2-dev.
+
+ -- Ximin Luo <infinity0@debian.org>  Mon, 01 May 2017 16:38:43 +0200
+
 cargo (0.17.0-1~exp1) experimental; urgency=medium
 
   * New upstream release. (Closes: #851089, #859312)
index 0aa8c2e1a4b8936f23873d6f5c47574e80a2e595..05612b4cdc7748e86ac40a274af491b1afead5a5 100644 (file)
@@ -7,7 +7,7 @@ Uploaders: Luca Bruno <lucab@debian.org>,
 Priority: extra
 Build-Depends: debhelper (>= 9.20141010),
                dpkg-dev (>= 1.17.14),
-               rustc (>= 1.13),
+               rustc (>= 1.16),
                pkg-config,
                cmake,
                cargo (>= 0.7.0) <!pkg.cargo.mkstage0>,
@@ -17,7 +17,7 @@ Build-Depends: debhelper (>= 9.20141010),
                bash-completion,
                libcurl4-gnutls-dev | libcurl4-openssl-dev,
                libssh2-1-dev,
-               libgit2-dev,
+               libgit2-dev (>= 0.25.1),
                libhttp-parser-dev,
                libssl-dev,
                zlib1g-dev
index 346a5d72f0dcf6b56cb55dfc736648edf195d95f..970cf3c0318c23258ac871176d2f5cf9935a872b 100644 (file)
@@ -13,18 +13,18 @@ Comment:
  notice may not be copied, modified, or distributed except
  according to those terms.
 
-Files: deps/*
-       deps/time-*
-       deps/libc-*
-       deps/bitflags-*
-       deps/semver-*
-       deps/log-*
-       deps/glob-*
-       deps/env_logger-*
-       deps/rustc-*
-       deps/term-*
-       deps/rustc-serialize-*
-       deps/regex-*
+Files: vendor/*
+       vendor/time-*
+       vendor/libc-*
+       vendor/bitflags-*
+       vendor/semver-*
+       vendor/log-*
+       vendor/glob-*
+       vendor/env_logger-*
+       vendor/rustc-*
+       vendor/term-*
+       vendor/rustc-serialize-*
+       vendor/regex-*
 Copyright: 2014-2015 The Rust Project Developers
 License: MIT-License or Apache-2.0
 Comment:
@@ -33,36 +33,36 @@ Comment:
  same MIT/Apache-2.0 dual-license. See https://github.com/rust-lang.
  Exceptions are noted below.
 
-Files: deps/advapi32-sys-*
-       deps/kernel32-*
-       deps/winapi-*
+Files: vendor/advapi32-sys-*
+       vendor/kernel32-*
+       vendor/winapi-*
 Copyright: 2015 Peter Atashian <retep998@gmail.com>
 License: MIT-License
 Comment: see https://github.com/retep998/winapi-rs
 
-Files: deps/url-*
+Files: vendor/url-*
 Copyright: 2015 Simon Sapin <simon.sapin@exyr.org>
 License: MIT-License or Apache-2.0
 Comment: see https://github.com/servo/rust-url
 
-Files: deps/matches-*
+Files: vendor/matches-*
 Copyright: 2015 Simon Sapin <simon.sapin@exyr.org>
 License: MIT-License
 Comment: see https://github.com/SimonSapin/rust-std-candidates
 
-Files: deps/num_cpus-*
+Files: vendor/num_cpus-*
 Copyright: 2015 Sean McArthur <sean.monstar@gmail.com>
 License: MIT-License
 Comment: see https://github.com/seanmonstar/num_cpus
 
-Files: deps/strsim-*
+Files: vendor/strsim-*
 Copyright: 2015 Danny Guo <dannyguo91@gmail.com>
 License: MIT-License
 Comment: see https://github.com/dguo/strsim-rs
 
-Files: deps/memchr-*
-       deps/aho-corasick-*
-       deps/docopt-*
+Files: vendor/memchr-*
+       vendor/aho-corasick-*
+       vendor/docopt-*
 Copyright: 2015 Andrew Gallant <jamslam@gmail.com>
 License: MIT-License or Unlicense
 Comment: see upstream projects,
@@ -70,59 +70,59 @@ Comment: see upstream projects,
  * https://github.com/BurntSushi/aho-corasick
  * https://github.com/docopt/docopt.rs
 
-Files: deps/openssl-sys-*
+Files: vendor/openssl-sys-*
 Copyright: 2015 Alex Crichton <alex@alexcrichton.com>
            2015 Steven Fackler <sfackler@gmail.com>
 License: MIT-License
 Comment: see https://github.com/sfackler/rust-openssl
 
-Files: deps/libz-sys-*
-       deps/libgit2-sys-*
-       deps/libssh2-sys-*
-       deps/miniz-sys-*
-       deps/gcc-*
-       deps/git2-*
-       deps/git2-curl-*
-       deps/filetime-*
-       deps/flate2-*
-       deps/pkg-config-*
-       deps/toml-*
-       deps/tar-*
+Files: vendor/libz-sys-*
+       vendor/libgit2-sys-*
+       vendor/libssh2-sys-*
+       vendor/miniz-sys-*
+       vendor/gcc-*
+       vendor/git2-*
+       vendor/git2-curl-*
+       vendor/filetime-*
+       vendor/flate2-*
+       vendor/pkg-config-*
+       vendor/toml-*
+       vendor/tar-*
 Copyright: 2014-2015 Alex Crichton <alex@alexcrichton.com>
 License: MIT-License or Apache-2.0
 Comment: see https://github.com/alexcrichton/
 
-Files: deps/miniz-sys-*/miniz.c
+Files: vendor/miniz-sys-*/miniz.c
 Copyright: Rich Geldreich <richgel99@gmail.com>
 License: Unlicense
 
-Files: deps/libgit2-sys-*/libgit2/*
+Files: vendor/libgit2-sys-*/libgit2/*
 Copyright: 2009-2012, the libgit2 contributors
 License: GPL-2 with linking exception
 
-Files: deps/libgit2-sys-*/libgit2/cmake/Modules/FindGSSAPI.cmake
+Files: vendor/libgit2-sys-*/libgit2/cmake/Modules/FindGSSAPI.cmake
 Copyright: 2013, Andreas Schneider <asn@cryptomilk.org>
 License: BSD-2-clause
 
-Files: deps/libgit2-sys-*/libgit2/include/git2/inttypes.h
-       deps/libgit2-sys-*/libgit2/include/git2/stdint.h
+Files: vendor/libgit2-sys-*/libgit2/include/git2/inttypes.h
+       vendor/libgit2-sys-*/libgit2/include/git2/stdint.h
 Copyright: 2006, Alexander Chemeris
 License: BSD-3-clause
 
-Files: deps/libgit2-sys-*/libgit2/src/khash.h
+Files: vendor/libgit2-sys-*/libgit2/src/khash.h
 Copyright: 2008, 2009, 2011, Attractive Chaos <attractor@live.co.uk>
 License: MIT-License
 
-Files: deps/libgit2-sys-*/libgit2/src/xdiff/*
+Files: vendor/libgit2-sys-*/libgit2/src/xdiff/*
 Copyright: 2003-2006, Davide Libenzi
            2003-2006, Johannes E. Schindelin
 License: LGPL-2.1+
 
-Files: deps/libgit2-sys-*/libgit2/src/xdiff/xhistogram.c
+Files: vendor/libgit2-sys-*/libgit2/src/xdiff/xhistogram.c
 Copyright: 2010, Google Inc and others from JGit's IP log.
 License: EDL-1.0
 
-Files: deps/libgit2-sys-*/libgit2/src/date.c
+Files: vendor/libgit2-sys-*/libgit2/src/date.c
 Copyright: 2005, Linus Torvalds
 License: GPL-2 with linking exception
 
diff --git a/debian/deps-tarball-filter.txt b/debian/deps-tarball-filter.txt
deleted file mode 100644 (file)
index 866af00..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# This is a list of files and dirs that should be filtered from
-# deps tarball for copyright/duplication reasons
-curl-sys-*/curl/
-libgit2-sys-*/libgit2/deps/
-libgit2-sys-*/libgit2/examples/
-libgit2-sys-*/libgit2/tests/
-libssh2-sys-*/libssh2*/
-libz-sys-*/src/zlib-*/
-strsim-*/docs/
-
-# To clean deps before making a new tarball, run
-# grep -v '^#' debian/deps-tarball-filter.txt | xargs -I% sh -c 'rm -rf %'
diff --git a/debian/deps-tarball-unsuspicious.txt b/debian/deps-tarball-unsuspicious.txt
deleted file mode 100644 (file)
index 9f5fb74..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# This is a list of files and dirs that are omitted from our custom
-# "suspicious files" scanner
-
-# test data
-flate2-*/tests/
-tar-*/tests/archives/
-term-*/tests/data/
-toml-*/tests/
-
-# misc support data
-hamcrest-*/LICENSE-*
-*/.travis.yml
-# "build status" link-images etc take up a lot of line-length
-*/README.md
-
-# individual files, manually audited:
-idna-*/tests/IdnaTest.txt
-idna-*/src/uts46_mapping_table.rs
-regex-*/src/testdata/basic.dat
-regex-*/tests/fowler.rs
-libgit2-sys-*/libgit2/src/openssl_stream.c
-term-*/scripts/id_rsa.enc
-url-*/github.png
-num-*/doc/favicon.ico
-num-*/doc/rust-logo-128x128-blk-v2.png
-num-*/.travis/deploy.enc
-miniz-sys-*/miniz.c
-docopt-*/src/test/testcases.rs
-winapi-*/src/winnt.rs
index cbdd2d0602b2a65ffab96d9eaadf5cf8873cea80..4034a8d09631948ce22ee661a553ee782f1d745a 100644 (file)
@@ -3,11 +3,11 @@ upstream-tag = upstream/%(version)s
 debian-tag = debian/%(version)s
 pristine-tar = True
 upstream-branch = upstream
-debian-branch = debian/sid
 
 [buildpackage]
 submodules = True
 
 [import-orig]
 upstream-vcs-tag = %(version)s
-component = deps
+component = vendor
+debian-branch = debian/experimental
index 040b0c62dc649ec481456e5a2971bff2ecfdb0cf..ddd3073a84a79df2bbf4e42a9083cf706a1cf078 100755 (executable)
@@ -24,8 +24,8 @@ if [ -z "$1" ]
 fi;
 
 BOOTSTRAP_PY=$(find "${PWD}" -name bootstrap.py -type f)
-DEPS_FILTER=$(find "${PWD}" -name deps-tarball-filter.txt -type f)
-DEPS_SUS_WHITELIST=$(find "${PWD}" -name deps-tarball-unsuspicious.txt -type f)
+VENDOR_FILTER=$(find "${PWD}" -name vendor-tarball-filter.txt -type f)
+VENDOR_SUS_WHITELIST=$(find "${PWD}" -name vendor-tarball-unsuspicious.txt -type f)
 
 # Download cargo tarball
 uscan --rename ${USCAN_ARGS} --force-download --destdir "${TMPDIR}/"
@@ -46,36 +46,35 @@ export GIT_AUTHOR_NAME="deb-build"
 export GIT_AUTHOR_EMAIL="<>"
 export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME}"
 export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL}"
-cargo vendor --explicit-version --verbose deps
+cargo vendor --explicit-version --verbose
 
-# Unpack artifacts and clean embedded libs
-${WORKDIR}/debian/cargo-vendor-unpack.py
-grep -v '^#' ${DEPS_FILTER} | xargs  -I% sh -c 'rm -rf deps/%'
-for i in deps/*; do ${WORKDIR}/debian/cargo-checksums-prune.py "$i"; done
+# Clean embedded libs and update checksums
+grep -v '^#' ${VENDOR_FILTER} | xargs  -I% sh -c 'rm -rf vendor/%'
+for i in vendor/*; do ${WORKDIR}/debian/cargo-checksums-prune.py "$i"; done
 
 # Report any suspicious files
-cp -R deps deps-scan
-grep -v '^#' ${DEPS_SUS_WHITELIST} | xargs  -I% sh -c 'rm -rf deps-scan/%'
+cp -R vendor vendor-scan
+grep -v '^#' ${VENDOR_SUS_WHITELIST} | xargs  -I% sh -c 'rm -rf vendor-scan/%'
 echo "Checking for suspicious files..."
 # The following shell snippet is a bit more strict than suspicious-source(1)
-find deps-scan -type f -and -not -name '.cargo-checksum.json' -exec file '{}' \; | \
+find vendor-scan -type f -and -not -name '.cargo-checksum.json' -exec file '{}' \; | \
   sed -e 's/\btext\b\(.*\), with very long lines/verylongtext\1/g' | \
   grep -v '\b\(text\|empty\)\b' || true
 echo "The above files (if any) seem suspicious, please audit them."
-echo "If good, add them to ${DEPS_SUS_WHITELIST}."
-echo "If bad, add them to ${DEPS_FILTER}."
-rm -rf deps-scan
+echo "If good, add them to ${VENDOR_SUS_WHITELIST}."
+echo "If bad, add them to ${VENDOR_FILTER}."
+rm -rf vendor-scan
 
 # Pack it up, reproducibly
 GZIP=-9n tar --sort=name \
     --mtime="./Cargo.lock" \
     --owner=root --group=root \
-    -czf "${TMPDIR}/cargo_${CARGO_VER}.orig-deps.tar.gz" deps
+    -czf "${TMPDIR}/cargo_${CARGO_VER}.orig-vendor.tar.gz" vendor
 
 # All is good, we are done!
 echo "Your files are available at:"
 echo "${TMPDIR}/cargo_${CARGO_VER}.orig.tar.gz \\"
-echo "${TMPDIR}/cargo_${CARGO_VER}.orig-deps.tar.gz"
+echo "${TMPDIR}/cargo_${CARGO_VER}.orig-vendor.tar.gz"
 echo ""
 echo "Unpacked cargo sources are available under:"
 echo "${TMPDIR}/cargo/"
index fa16496aea898390a63e731b565060b038ec7559..5b797c6018ea58f10c41d1f50ca8166f2b1af938 100755 (executable)
@@ -3,42 +3,39 @@
 include /usr/share/dpkg/pkg-info.mk
 include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/buildflags.mk
+include /usr/share/rustc/architecture.mk
+
 RUSTFLAGS += $(foreach flag,$(LDFLAGS),-C link-arg=$(flag))
 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
 
-rust_cpu = $(subst i586,i686,$(1))
-DEB_HOST_RUST_TYPE := $(call rust_cpu,$(DEB_HOST_GNU_CPU))-unknown-$(DEB_HOST_GNU_SYSTEM)
-DEB_TARGET_RUST_TYPE := $(call rust_cpu,$(DEB_TARGET_GNU_CPU))-unknown-$(DEB_TARGET_GNU_SYSTEM)
-
 # Cargo looks for config in and writes cache to $CARGO_HOME/
 export CARGO_HOME = $(CURDIR)/debian/cargohome
 # Ask cargo to be verbose when building
 export VERBOSE = 1
 
-DEB_DESTDIR := $(CURDIR)/debian/tmp
-VENDORDIR := $(CURDIR)/vendor
-INDEXDIR := $(CURDIR)/vendor/index
-DEPSDIR := $(CURDIR)/deps
-
 %:
        dh $@ --with bash-completion
 
 override_dh_auto_configure:
        cp -a $(CURDIR)/Cargo.lock $(CURDIR)/.Cargo.lock.orig
 ifneq ($(filter pkg.cargo.mkstage0,$(DEB_BUILD_PROFILES)),)
+       # NOTE: this very likely doesn't work any more, see bootstrap.py for details
+       # Instead, you can try to bootstrap by setting PATH to a binary cargo
+       # downloaded from upstream, or by (TODO) cross-compiling.
+       # Preserved in case someone wants to resurrect it later:
        # Bootstrap cargo stage0
        ./debian/bootstrap.py \
                --no-clean \
                --no-clone \
                --no-git \
                --no-download \
-               --crate-index $(INDEXDIR)/ \
+               --crate-index $(CURDIR)/vendor/index / \
                --cargo-root $(CURDIR)/ \
-               --target-dir $(DEPSDIR)/ \
+               --target-dir $(CURDIR)/deps \
                --host=$(DEB_HOST_RUST_TYPE) \
                --target=$(DEB_TARGET_RUST_TYPE)
        # Workaround for https://github.com/rust-lang/cargo/issues/1423
-       ln -s `find $(DEPSDIR) -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
+       ln -s `find $(CURDIR)/deps -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
 else
        ln -s `which cargo` $(CURDIR)/cargo-stage0
 endif
@@ -69,14 +66,9 @@ override_dh_auto_test:
 override_dh_auto_clean:
        -mv $(CURDIR)/.Cargo.lock.orig $(CURDIR)/Cargo.lock
        dh_auto_clean
-       -$(RM) -r $(CURDIR)/deps/*.rlib \
-                       $(CURDIR)/deps/build_script* \
-                       $(CURDIR)/deps/cargo* \
-                       $(CURDIR)/deps/*.o \
-                       $(CURDIR)/target/ \
+       -$(RM) -r $(CURDIR)/target/ \
                        $(CURDIR)/.cargo \
                        $(CURDIR)/config.mk \
                        $(CURDIR)/config.stamp \
                        $(CURDIR)/Makefile \
-                       $(CURDIR)/cargo-stage0 \
-                       $(VENDORDIR)
+                       $(CURDIR)/cargo-stage0
diff --git a/debian/vendor-tarball-filter.txt b/debian/vendor-tarball-filter.txt
new file mode 100644 (file)
index 0000000..c588100
--- /dev/null
@@ -0,0 +1,10 @@
+# This is a list of files and dirs that should be filtered from
+# deps tarball for copyright/duplication reasons
+curl-sys-*/curl/
+libgit2-sys-*/libgit2*/
+libssh2-sys-*/libssh2*/
+libz-sys-*/src/zlib-*/
+strsim-*/docs/
+
+# To clean deps before making a new tarball, run
+# grep -v '^#' debian/deps-tarball-filter.txt | xargs -I% sh -c 'rm -rf %'
diff --git a/debian/vendor-tarball-unsuspicious.txt b/debian/vendor-tarball-unsuspicious.txt
new file mode 100644 (file)
index 0000000..9f5fb74
--- /dev/null
@@ -0,0 +1,29 @@
+# This is a list of files and dirs that are omitted from our custom
+# "suspicious files" scanner
+
+# test data
+flate2-*/tests/
+tar-*/tests/archives/
+term-*/tests/data/
+toml-*/tests/
+
+# misc support data
+hamcrest-*/LICENSE-*
+*/.travis.yml
+# "build status" link-images etc take up a lot of line-length
+*/README.md
+
+# individual files, manually audited:
+idna-*/tests/IdnaTest.txt
+idna-*/src/uts46_mapping_table.rs
+regex-*/src/testdata/basic.dat
+regex-*/tests/fowler.rs
+libgit2-sys-*/libgit2/src/openssl_stream.c
+term-*/scripts/id_rsa.enc
+url-*/github.png
+num-*/doc/favicon.ico
+num-*/doc/rust-logo-128x128-blk-v2.png
+num-*/.travis/deploy.enc
+miniz-sys-*/miniz.c
+docopt-*/src/test/testcases.rs
+winapi-*/src/winnt.rs